import request from '@/utils/request'

// 查询采购计划(es_procurement_plan)列表
export function listPlan(query) {
  return request({
    url: '/procurementmanagement/plan/list',
    method: 'get',
    params: query
  })
}

// 查询采购计划(es_procurement_plan)详细
export function getPlan(id) {
  return request({
    url: '/procurementmanagement/plan/' + id,
    method: 'get'
  })
}

// 新增采购计划(es_procurement_plan)
export function addPlan(data) {
  return request({
    url: '/procurementmanagement/plan',
    method: 'post',
    data: data
  })
}

// 修改采购计划(es_procurement_plan)
export function updatePlan(data) {
  return request({
    url: '/procurementmanagement/plan',
    method: 'put',
    data: data
  })
}

// 删除采购计划(es_procurement_plan)
export function delPlan(id) {
  return request({
    url: '/procurementmanagement/plan/' + id,
    method: 'delete'
  })
}

// 获取部门树
export function getDeptTree() {
  return request({
    url: '/procurementmanagement/plan/tree',
    method: 'get',
  })
}

//获取编制人
export function getCompiler() {
  return request({
    url: '/procurementmanagement/plan/compiler',
    method: 'get',
  })
}

//获取供应商
export function getSupplierList() {
  return request({
    url: '/procurementmanagement/plan/supplier',
    method: 'get',
  })
}

//获取供应商详情
export function getsupplierListBid(id) {
  return request({
    url: `/procurementmanagement/plan/${id}/supplierListBid`,  // 修改路径
    method: 'get',
  });
}
